import 'package:flutter_demo/model/prompts_model.dart';

/// id : 0
/// name : ""
/// prompts : [{"id":1,"prompt":"","secondCategoryId":0,"selected":true}]

class MagicPromptModel {
  MagicPromptModel({
      this.id, 
      this.name, 
      this.prompts,});

  MagicPromptModel.fromJson(dynamic json) {
    id = json['id'];
    name = json['name'];
    if (json['prompts'] != null) {
      prompts = [];
      json['prompts'].forEach((v) {
        prompts?.add(PromptsModel.fromJson(v));
      });
    }
  }
  int? id;
  String? name;
  List<PromptsModel>? prompts;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['name'] = name;
    if (prompts != null) {
      map['prompts'] = prompts?.map((v) => v.toJson()).toList();
    }
    return map;
  }

}

